<template>

    <el-container class="home-container">
        <!-- 头部区域 -->
        <el-header>
            <div>
                <!-- <img src="../assets/logo.png" alt=""> -->
                <span>LOGO</span>
                <span>汽车修理管理系统</span>
            </div>
            <el-button type="info" @click="logout">退出</el-button>
        </el-header>
        <!-- 页面主体区域 -->
        <el-container>
            <!-- 侧边栏 -->
            <el-aside width="200px">
                    <!-- 侧边栏菜单区 -->
                    <el-menu background-color="#d3d3d3" text-color="#000000"
                    active-text-color="#000000">
                    <el-menu-item index="1">
                        <template #title>
                        <i class="el-icon-s-order"></i>
                        <router-link to="/repair">修车登记</router-link>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="2">
                        <template #title>
                        <i class="el-icon-s-custom"></i>
                        <router-link to="/employee">员工管理</router-link>
                        </template>
                    </el-menu-item>
                    <el-submenu index="3">
                        <template #title>
                        <i class="el-icon-house"></i>
                        <span>零件库存</span>
                        </template>
                            <el-menu-item index="1-1">
                                <router-link to="/inbound">零件入库</router-link>
                            </el-menu-item>
                            <el-menu-item index="1-2">
                                <router-link to="outbound">零件出库</router-link>
                            </el-menu-item>
                    </el-submenu>
                    <el-submenu index="4">
                        <template #title>
                        <i class="el-icon-data-line"></i>
                        <span>数据统计</span>
                        </template>
                            <el-menu-item index="1-1">
                                <router-link to="/plan">订货计划月报表</router-link>
                            </el-menu-item>
                            <el-menu-item index="1-2">
                                <router-link to="/salary">修理工工资月报表</router-link>
                            </el-menu-item>
                            <el-menu-item index="1-3">
                                <router-link to="/bill">订单发票</router-link>
                            </el-menu-item>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <!-- 右边内容主体 -->
            <el-main>
                <!-- welcome路由占位 -->
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
export default {
  data() {
    return {
        }
    },
    methods: {
        created() {
            this.getMenuList()
        },
        logout() {
            window.sessionStorage.clear()
            this.$router.push('./login')
        },
        
    }
}
</script>

<style lang="less" scoped>
.home-container{
    height: 100%;
}

.el-header {
    background-color: #4f4d4d;
    display: flex;
    justify-content: space-between;
    padding-left: 0;
    align-items: center;
    color: #fff;
    font-size: 20px;
    > div {
        display: flex;
        align-items: center;
        span {
            margin-left: 15px;
        }

    }
}

.el-aside {
    background-color: #d3d3d3;
}

.el-main {
    background-color: #f1f5f5;
}
</style>
